package com.dyna.demo.valid.domain;

import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author zhoucaiwang
 * @date 2023/10/28
 */

@Data
public class Demo implements Serializable {

    @NotBlank(message = "姓名不能为空")
    private  String name;

    private  String age;

    @NotNull(message = "性别不能为空")
    private  Integer sex;

    private  String address;

    @Email(message = "邮箱格式不正确")
    private  String email;

    private  String phone;

    private Friend friend;

    @Data
    public static class Friend {

        private  String name;

        private  String age;

        private  String sex;

    }

}
